# 绑定重载配置快捷键为r
unbind C-b
set -g prefix 'C-q'
set-option -g repeat-time 0
bind r source-file ~/.tmux.conf \; display-message "Config reloaded.."
unbind '"'
bind v splitw -v -c '#{pane_current_path}' # 垂直方向新增面板，默认进入当前目录
unbind '%'
bind b splitw -h -c '#{pane_current_path}' # 水平方向新增面板，默认进入当前目录
# 开启鼠标支持
#set-option -g mouse on
# 绑定hjkl键为面板切换的上下左右键
bind -r k select-pane -U # 绑定Ctrl+k为↑
bind -r j select-pane -D # 绑定Ctrl+j为↓
bind -r h select-pane -L # 绑定Ctrl+h为←
bind -r l select-pane -R # 绑定Ctrl+l为→
# 绑定Ctrl+hjkl键为面板上下左右调整边缘的快捷指令
bind -r K resizep -U 10 # 绑定k为往↑调整面板边缘10个单元格
bind -r J resizep -D 10 # 绑定j为往↓调整面板边缘10个单元格
bind -r H resizep -L 10 # 绑定h为往←调整面板边缘10个单元格
bind -r L resizep -R 10 # 绑定l为往→调整面板边缘10个单元格
#bind -n C-j clear-history

#set -g mouse on
#bind-key -n DoubleClick1Pane \
#    select-pane \; \
#    copy-mode -M \; \
#    send-keys -X select-word \; \
#    run-shell "sleep .5s" \; \
#    send-keys -X copy-pipe-and-cancel "pbcopy"

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
run -b '~/.tmux/plugins/tpm/tpm'
# 禁用滚动鼠标时，变成历史命令滚动
# 配合iTerm2中的配置“Save lines to scrollback when an app status bar is present”
# 可以达到tmux在iTerm2中流畅滚动的效果
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
setw -g mode-keys vi
